package edu.sandau.basic.vo;

import edu.sandau.basic.domain.User;
import edu.sandau.basic.global.GlobalEnum;
import java.util.List;

public class BasicMsg {
    private GlobalEnum.OperationResult operationResult = GlobalEnum.OperationResult.UNSUCC;
    private String errorMsg = "";
    private GlobalEnum.ErrorCode errorCode = GlobalEnum.ErrorCode.UNKNOWN;
    private List<?> data; // 使用泛型，支持不同类型的数据
    public void setErrorMsg(String errMsg){
        this.errorMsg = errMsg;
    }
    public String getErrorMsg(){
        return this.errorMsg;
    }
    public GlobalEnum.OperationResult getOperationResult(){
        return this.operationResult;
    }
    public void setErrorCode(GlobalEnum.ErrorCode errorCode){
        this.errorCode = errorCode;
    }
    public void setOperationResult(GlobalEnum.OperationResult operationResult){
        this.operationResult = operationResult;
    }
    public GlobalEnum.ErrorCode getErrorCode(){
        return this.errorCode;
    }
    
    @SuppressWarnings("unchecked")
    public <T> List<T> getData() {
        return (List<T>) data;
    }
    
    public <T> void setData(List<T> data) {
        this.data = data;
    }
}

